
package risk.game.entity;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;

import risk.game.entity.map.World;
import risk.game.entity.player.Player;


public class Game {
    private Queue<Player> activePlayerQ;
    private List<Player>  inActivePlayerList;
    
    private World world;
	
    public Game(){
    	this.activePlayerQ = new LinkedList<Player>();
    	this.inActivePlayerList = new ArrayList<Player>();
    }
    
    public Queue<Player> getActivePlayerQ() {
		return activePlayerQ;
	}
	public void setActivePlayerQ(Queue<Player> activePlayerQ) {
		this.activePlayerQ = activePlayerQ;
	}
	public World getWorld() {
		return world;
	}
	public void setWorld(World world) {
		this.world = world;
	}
	
    public List<Player> getInActivePlayerList() {
		return inActivePlayerList;
	}

	public void setInActivePlayerList(List<Player> inActivePlayerList) {
		this.inActivePlayerList = inActivePlayerList;
	}

	public void addActivePlayer(Player player){
    	activePlayerQ.add(player);
    	player.setActiveStatus();
    }
    public boolean removeActivePlayer(Player player){
    	if(activePlayerQ != null){
    		// if player exists in active Q --> remove the player from active Q
	    	if(activePlayerQ.remove(player)){
	    		// set it as inactive
	    		player.setInActiveStatus();
	    		// add player to inactive list
	    		inActivePlayerList.add(player);
	    		return true;
	    	}
    	}
    	return false;
    }
	
    
}
